﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    Inherits="Pages_Reservation_Calendar" CodeBehind="Calendar.aspx.cs" %>

<%@ Register Src="~/Pages/Reservations/Ascx/StickyPopup.ascx" TagName="StickyPopup"
    TagPrefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="using" runat="Server">
    <script src="/js/jquery.tooltip.js" type="text/javascript"></script>
    <script src="/Pages/Reservations/Js/calendar.js" type="text/javascript"></script>
    <link href="/css/jquery.tooltip.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="header" runat="Server">
    <uc1:StickyPopup ID="StickyPopup" runat="server" />
    <% if (HttpContext.Current.User.IsInRole(define.AdminRole))
       { %>
    <a id="btnSticky" class="button header" href="javascript:void(0)"><span>Create new the
        sticky note</span></a>
    <% } %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="content" runat="Server">
    <div style="margin: 10px 3px 0 3px">
        <h1 style="text-indent: 10px;">
            Calendar</h1>
        <asp:Panel ID="panel1" runat="server" BackColor="AliceBlue" DefaultButton="btnCheck">
            <table style="margin: 15px;">
                <tr>
                    <td>
                        Boating date:
                    </td>
                    <td>
                        <asp:TextBox ID="txtDepartureDate" runat="server" CssClass="datepicker"></asp:TextBox>
                    </td>
                    <td rowspan="3">
                        Choose boat:
                    </td>
                    <td rowspan="3">
                        <asp:CheckBoxList RepeatDirection="Vertical" RepeatColumns="3" ID="chkBoat" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:RadioButton ID="radShowAll" runat="server" Text="Show all" GroupName="AW" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:RadioButton ID="radOnlyBooked" runat="server" Text="Only booked cabins" GroupName="AW" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:LinkButton ID="btnLeft" runat="server" OnClick="OnLeft" CssClass="button group"><span>&laquo;</span></asp:LinkButton>
                        <asp:LinkButton ID="btnCheck" runat="server" OnClick="OnCheckCabin" CssClass="button group"><span>Check cabins</span></asp:LinkButton>
                        <asp:LinkButton ID="btnRight" runat="server" OnClick="OnRight" CssClass="button group"><span>&raquo;</span></asp:LinkButton>
                    </td>
                    <td colspan="2">
                        <div style="width: 20px; height: 15px; background-color: #ffdf51; float: left;">
                        </div>
                        <span style="float: left; margin-right: 10px;">Booked</span>
                        <div style="width: 20px; height: 15px; background-color: #77ff77; float: left;">
                        </div>
                        <span style="float: left; margin-right: 10px;">Blocked</span>
                        <div style="width: 20px; height: 15px; background-color: #7e9cff; float: left;">
                        </div>
                        <span style="float: left; margin-right: 10px;">Charter</span>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <div id="set1">
            <asp:GridView ID="grv" runat="server" CssClass="grid" AllowSorting="true" AutoGenerateColumns="false"
                Style="border-color: #eaeaea" DataKeyField="BoatID">
                <Columns>
                    <asp:BoundField HeaderText="Boat#" DataField="BoatID" HeaderStyle-Width="50" HeaderStyle-HorizontalAlign="Center">
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Cabin" DataField="CabinNumber" HeaderStyle-Width="30"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Height="40px">
                    </asp:BoundField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfColor" runat="server" Value='<%# Eval("BoatColor") %>' />
                            <asp:HiddenField ID="hdfCss_Monday" runat="server" Value='<%# Eval("Monday.CssClass") %>' />
                            <asp:LinkButton ID="btnReply" runat="server" OnClick="OnLeft">
                                <div style="float: left; cursor: pointer; width: 18px; height: 98px; background: url('../../Images/relativeLeft.png') no-repeat left center; display: <%#Eval("Monday.BackButton") ?? "none"%>"></div>
                            </asp:LinkButton>
                            <label style="float: left;" title="<%# Eval("Monday.Tooltip") %>" for="textl">
                                <a id="monday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Monday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Monday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Monday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Monday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Tuesday" runat="server" Value='<%# Eval("Tuesday.CssClass") %>' />
                            <label title="<%# Eval("Tuesday.Tooltip") %>" for="textl">
                                <a id="tuesday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Tuesday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Tuesday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Tuesday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Tuesday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Wednesday" runat="server" Value='<%# Eval("Wednesday.CssClass") %>' />
                            <label title="<%# Eval("Wednesday.Tooltip") %>" for="textl">
                                <a id="webnesday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Wednesday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Wednesday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Wednesday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Wednesday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Thursday" runat="server" Value='<%# Eval("Thursday.CssClass") %>' />
                            <label title="<%# Eval("Thursday.Tooltip") %>" for="textl">
                                <a id="thursday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Thursday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Thursday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Thursday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Thursday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Friday" runat="server" Value='<%# Eval("Friday.CssClass") %>' />
                            <label title="<%# Eval("Friday.Tooltip") %>" for="textl">
                                <a id="friday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Friday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Friday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Friday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Friday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Saturday" runat="server" Value='<%# Eval("Saturday.CssClass") %>' />
                            <label title="<%# Eval("Saturday.Tooltip") %>" for="textl">
                                <a id="saturday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Saturday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Saturday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Saturday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Saturday.EndDateString")%></div>
                            </label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="hdfCss_Sunday" runat="server" Value='<%# Eval("Sunday.CssClass") %>' />
                            <label style="float: left;" title="<%# Eval("Sunday.Tooltip") %>" for="textl">
                                <a id="sunday" href="ReservationEdit.aspx?ReservationID=<%#Eval("Sunday.ReservationID") %>">
                                    <div>
                                        <%# Eval("Sunday.BookingCode")%></div>
                                </a>
                                <div style="color: gray">
                                    <%# Eval("Sunday.DepartureDateString")%></div>
                                <div style="color: gray">
                                    <%# Eval("Sunday.EndDateString")%></div>
                            </label>
                            <asp:LinkButton ID="btnForward" runat="server" OnClick="OnRight">
                                <div style="float: right; cursor: pointer; width: 18px; height: 98px; background: url('../../Images/relativeRight.png') no-repeat right center; display: <%#Eval("Sunday.ForwardButton") ?? "none"%>"></div>
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="gridheader" />
                <%--<RowStyle CssClass="gridrow" />
                <AlternatingRowStyle CssClass="alternatingrow" />--%>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
